package com.lipaluma.examples.annotation.multiple;

import java.util.Collection;

import com.lipaluma.annotations.mapping.MapMultipleColumns;
import com.lipaluma.annotations.validations.Validate;
import com.lipaluma.csv.annotations.config.CSV;
import com.lipaluma.field.validator.strategies.LengthStrategy;

@CSV(delimiter=';', trimAll=false, hasHeader=true, mapColumnsByHeaders=true)
public class Client {
	private Long id;
	private String name;
	
	@MapMultipleColumns(names={"STREET", "ZIP", "CITY"}, eachValueRequired=true, separator=" ")
	@Validate(length=15, lengthStrategy=LengthStrategy.GREATER_THAN_OR_EQUALS)
	private String address;

//	@MapWith(AggregateMultipleFieldMapper.class)
//	@TrimOnEachValue
//	@AggregateMultipleMappingInCollection(names={"ALIAS_1","ALIAS_2","ALIAS_3","ALIAS_4","ALIAS_5"}, keepAll=true)
//	@CollectionSize(strategy=LengthStrategy.GREATER_THAN_OR_EQUALS, value=5)
//	@EachValueUnique
//	@EachValueRequired
//	@SubStringRequiredOnEachValue(value="Pix", all=false)
	@MapMultipleColumns(names={"ALIAS_1","ALIAS_2","ALIAS_3","ALIAS_4","ALIAS_5"}, keepAll=true, trim=true)
//	@ValidateCollection(length=5, lengthStrategy=LengthStrategy.GREATER_THAN_OR_EQUALS)
//	@Validate(contains="pix", unique=true)
	private Collection<String> aliases;
	
	public Long getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	public String getAddress() {
		return address;
	}
	
	public Collection<String> getAliases() {
		return aliases;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public void setAliases(Collection<String> aliases) {
		this.aliases = aliases;
	}
}
